﻿using System;
using System.Text;

namespace OST.Shared.SharedTypes
{
    /// <summary>
    /// represents the location configuration
    /// </summary>
    public class LocationConfiguration
    {        
        #region CTOR

        public LocationConfiguration()
        {
            Long = 0.0;
            Lat = 0.0;
        }
        #endregion

        #region Properties
        
        /// <summary>
        /// Latitude (dt.: 'Längengrad')
        /// </summary>
        public double Long { get; set; }

        /// <summary>
        /// Latitude (dt.: 'Breitengrad')
        /// </summary>
        public double Lat { get; set; }

        #endregion

        #region Methods

        /// <summary>
        /// validates the this instance
        /// </summary>
        public void Validate()
        {
            if (Long <= 0.0 || Lat <= 0.0)
                throw new OSTException("config: Location is invalid");
        }

        public override string ToString()
        {
            var str = new StringBuilder();
            
            str.AppendLine();
            str.AppendLine("Long: " + Long);
            str.AppendLine("Lat: " + Lat);

            return str.ToString();
        }

        #endregion
    }
}
